package com.zhibang.report.controller;

import com.sannuo.common.domain.Consumer;
import com.sannuo.common.result.Result;
import com.sannuo.common.result.ResultCode;
import com.zhibang.report.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/con")
public class ConsumerController {
    @Autowired
    private ConsumerService consumerService;

    @RequestMapping(value = "Atlas",method = RequestMethod.GET)
    public Result Atlas(){
        List<Consumer> consumers = consumerService.selectConsumer();
        return Result.ok(ResultCode.SUCCESS,consumers);
    }
}
